package com.snjx.netty.chat.entity;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName User
 * @Author yunlong.zhang
 * @Date 2018/11/19
 * @since: JDK 1.8
 * @Description //TODO
 **/
@Entity
@Table(name = "t_user")
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class User implements Serializable {

    private static final long serialVersionUID = -823127276359708492L;

    @Id
    //@GeneratedValue(strategy = GenerationType.AUTO)
    Integer id;
    @Column(name = "nick_name",nullable=true,length=20) //声明数据 库字段和类属性对应关系
    String nickName;
    @Column(name = "pass_word",nullable=true,length=50) //声明数据 库字段和类属性对应关系
    String password;
    @Column(name = "create_time")
    @Temporal(TemporalType.TIMESTAMP) //这个是带时分秒的类型
    Date createTime;
}
